List of client's employees
This request is used to get a list of a client's employees.
Request syntax
GET https://b2b-api.go.yandex.ru/integration/2.0/users?
&limit=<number of records>
&cursor=<tag from the previous request>
Warning
The list of employees is sorted by creation time in ascending order (employees with the earliest creation date will always be on the first page).
Request headers
Authorization: Bearer <OAuth-token>
OAuth access token. The steps to get a token are described in Getting started.
X-YaTaxi-Selected-Corp-Client-Id— client ID from the account. Required if multiple clients are available using the token.
Request parameters
The request may contain the following optional parameters:
-
limit: The number of records to print. If this parameter is omitted, information about the first 100 records is returned. -
cursor: The request tag (returned in the body of the response to the previous request). You don't need to specify this parameter for the request of the first page, but you need to do it for all subsequent pages.
Response field description
Responses may contain the following fields:
| Field | Description | Format |
|---|---|---|
items |
The list of a client's employees. | Array |
cursor |
The tag of the current request. | String |
next_cursor |
The tag for the next request. To get the next page, you need to pass the value from the next_cursor field to the cursor GET parameter. If the response is empty, there will be no next_cursor field. |
String |
limit |
The maximum number of records to return. | Number |
total_amount |
The number of records found. | Number |
Structure of the items array element:
| Field | Description | Format |
|---|---|---|
client_id |
The client's ID (account). | String |
_id |
The employee's ID. | String |
is_deleted |
Whether the employee is deleted (whether they're visible in the interface), deleted employees can't be active. | Boolean |
cost_center |
The name of the client's cost center. | String |
phone |
The employee's phone number. | String |
nickname |
The employee's short name. | String |
limits |
The number of records returned. | Number |
is_active |
Indicates that the employee is active. An inactive employee can't place an order and rides can't be ordered in their name. | Boolean |
cost_centers_id |
ID of the cost center settings list. Optional field. | String |
fullname |
The employee's full name. | String |
Structure of the limits array element:
| Field | Description | Format |
|---|---|---|
limit_id |
Limit ID | String |
service |
The name of the limit service. Acceptable values: taxi, eats2, drive, tanker, grocery. |
String |
Request examples
The first request:
GET https://b2b-api.go.yandex.ru/integration/2.0/users?limit=100
...
Authorization: <OAuth token>
Subsequent requests:
GET https://b2b-api.go.yandex.ru/integration/2.0/users?limit=100&cursor=djEgMTY2MjcyMzI2MS4yMzEgYWE4NDBhMTE0MGFjNDMzYmI5NDJiNDYzZjA5MGM3OTE=
...
Authorization: <OAuth token>
Response example
An example response to this request looks like this:
{
"items": [
{
"cost_centers_id": "4d6ffae7af844b…",
"is_active": true,
"email": "email1@email.ru",
"limits": [
{
"limit_id": "e31cc52437…",
"service": "eats2"
},
{
"limit_id": "4afef98…..20569bb9d",
"service": "drive"
}
],
"client_id": "1f300a6…..edf867021c",
"department_id": "9080a2……208a1856",
"fullname": "First name... Last name... ",
"cost_center": "",
"phone": "+79999999996",
"nickname": "id1234572",
"id": "0516587…..c5a8adb58",
"is_deleted": false
}
],
"limit": 10,
"total_amount": 28,
"cursor": "djEgMTY2Mjcy4yMz…..DMzYmI5NDJiNDYzZjA5MGM3OTE=",
"next_cursor": "djEgMTY2NjA3OTAN….GM4MTgwMDFlNTAzYjg3NTQ="
}
Response codes
The response to this request may contain the following standard HTTP codes:
200: Request completed successfully.400: An unknown parameter or a parameter with an invalid value was passed in the request.401: The OAuth token is incorrect.403: The client doesn't have sufficient rights to run this request.- SELECT_CLIENT_HEADER_REQUIRED: the request did not pass the header
X-YaTaxi-Selected-Corp-Client-Id(returned if more than one client is available for the token). - SELECTED_CLIENT_ACCESS_DENIED: the header
X-YaTaxi-Selected-Corp-Client-Idcontains the client's ID, which this login does not have access to.
- SELECT_CLIENT_HEADER_REQUIRED: the request did not pass the header